home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / bltw126.zip / BULLET.H < prev    next >
C/C++ Source or Header  |  1995-01-05  |  9KB  |  324 lines

  1. /*      bullet.h
  2.  
  3.         Defines the BULLET library's structs, consts, and function declaration
  4.  
  5.         v1.11 18-Nov-94
  6.  
  7.     ***********************************************************************
  8.     * NOTE: BULLET is for medium, large, or huge models (do not use tiny, *
  9.     * ---- small, or compact since these allow for only 1 code segment).  *
  10.     ***********************************************************************
  11.  
  12.      Struct types must be standard byte packed; do not special align elements
  13.      either here or in your source code.  This means that you must ensure
  14.      that any and all Bullet structure definitions are surrounded by the
  15.      appropriate compiler mechanism to do no special alignment (i.e., byte
  16.      alignment means no special alignment).  This includes, for example,
  17.      your data record (yourrecord.TAG is a byte field and this would be padded
  18.      by your compiler, throwing off all field offsets, as just one example).
  19.  
  20.      YOUR PROGRAM WILL NOT RUN CORRECTLY UNLESS THIS IS SO!
  21. */
  22.  
  23. #ifndef __BULLET_H
  24.  
  25. #pragma pack(1)
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. int     far pascal BULLET(void far *datapack);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34.  
  35. #define INITXB          0            /* system */
  36. #define EXITXB          1
  37. #define ATEXITXB        2
  38. #define MEMORYXB        3
  39. #define BREAKXB         4
  40. #define BACKUPFILEXB    5
  41. #define STATHANDLEXB    6
  42. #define GETEXTERRORXB   7
  43. #define DVMONCXB        9
  44.  
  45. #define CREATEDXB       10           /* data control mid-level */
  46. #define OPENDXB         11
  47. #define CLOSEDXB        12
  48. #define STATDXB         13
  49. #define READDHXB        14
  50. #define FLUSHDHXB       15
  51. #define COPYDHXB        16
  52. #define ZAPDHXB         17
  53.  
  54. #define CREATEKXB       20           /* key control mid-level */
  55. #define OPENKXB         21
  56. #define CLOSEKXB        22
  57. #define STATKXB         23
  58. #define READKHXB        24
  59. #define FLUSHKHXB       25
  60. #define COPYKHXB        26
  61. #define ZAPKHXB         27
  62.  
  63. #define GETDESCRIPTORXB 30           /* data access mid-level */
  64. #define GETRECORDXB     31
  65. #define ADDRECORDXB     32
  66. #define UPDATERECORDXB  33
  67. #define DELETERECORDXB  34
  68. #define UNDELETERECORDXB 35
  69. #define PACKRECORDSXB   36
  70.  
  71. #define FIRSTKEYXB      40           /* key access mid-level */
  72. #define EQUALKEYXB      41
  73. #define NEXTKEYXB       42
  74. #define PREVKEYXB       43
  75. #define LASTKEYXB       44
  76. #define STOREKEYXB      45
  77. #define DELETEKEYXB     46
  78. #define BUILDKEYXB      47
  79. #define CURRENTKEYXB    48
  80.  
  81. #define GETFIRSTXB      60           /* key & data access high-level */
  82. #define GETEQUALXB      61
  83. #define GETNEXTXB       62
  84. #define GETPREVXB       63
  85. #define GETLASTXB       64
  86. #define INSERTXB        65
  87. #define UPDATEXB        66
  88. #define REINDEXXB       67
  89.  
  90. #define LOCKXB          80           /* network control */
  91. #define UNLOCKXB        81
  92. #define LOCKKEYXB       82
  93. #define UNLOCKKEYXB     83
  94. #define LOCKDATAXB      84
  95. #define UNLOCKDATAXB    85
  96. #define DRIVEREMOTEXB   86
  97. #define FILEREMOTEXB    87
  98. #define SETRETRIESXB    88
  99.  
  100. #define DELETEFILEDOS   100          /* DOS file I/O low-level */
  101. #define RENAMEFILEDOS   101
  102. #define CREATEFILEDOS   102
  103. #define OPENFILEDOS     103
  104. #define SEEKFILEDOS     104
  105. #define READFILEDOS     105
  106. #define WRITEFILEDOS    106
  107. #define CLOSEFILEDOS    107
  108. #define ACCESSFILEDOS   108
  109. #define EXPANDFILEDOS   109
  110. #define MAKEDIRDOS      110
  111.  
  112. #define cUNIQUE         1            /* key type flags */
  113. #define cCHAR           2
  114. #define cINTEGER        16
  115. #define cLONG           32
  116. #define cNLS            0x4000       /* note: cNLS is set by BULLET */
  117. #define cSIGNED         0x8000
  118.  
  119. #define READONLY        0            /* do NOT use O_RDONLY,O_WRONLY,O_RDWR */
  120. #define WRITEONLY       1
  121. #define READWRITE       2
  122.  
  123. #define COMPAT          0X0000       /* okay to use SH_DENYRW, etc. */
  124. #define DENYREADWRITE   0x0010       /* or O_DENYREADWRITE, etc.    */
  125. #define DENYWRITE       0x0020
  126. #define DENYREAD        0x0030
  127. #define DENYNONE        0x0040
  128. #define NOINHERIT       0x0080
  129.  
  130.  
  131. struct accesspack {
  132.         unsigned        func;
  133.         unsigned        stat;
  134.         unsigned        handle;
  135.         long            recno;       /* signed */
  136.         void       far *recptr;
  137.         void       far *keyptr;
  138.         void       far *nextptr;
  139. }; /* 22 */
  140.  
  141. struct breakpack {
  142.         unsigned        func;
  143.         unsigned        stat;
  144.         unsigned        mode;
  145. }; /* 6 */
  146.  
  147. struct copypack {
  148.         unsigned        func;
  149.         unsigned        stat;
  150.         unsigned        handle;
  151.         char       far *filenameptr;
  152. }; /* 10 */
  153.  
  154. struct createdatapack {
  155.         unsigned        func;
  156.         unsigned        stat;
  157.         char       far *filenameptr;
  158.         unsigned        nofields;
  159.         void       far *fieldlistptr;
  160.         unsigned        fileid;
  161. }; /* 16 */
  162.  
  163. struct createkeypack {
  164.         unsigned        func;
  165.         unsigned        stat;
  166.         char       far *filenameptr;
  167.         char       far *keyexpptr;
  168.         unsigned        xblink;
  169.         unsigned        keyflags;
  170.         int             codepageid;
  171.         int             countrycode;
  172.         char       far *collateptr;
  173. }; /* 24 */
  174.  
  175. struct fielddesctype {
  176.         char            fieldname[11];
  177.         char            fieldtype[1];
  178.         unsigned long   fieldda;
  179.         unsigned char   fieldlen;
  180.         unsigned char   fielddc;
  181.         long            fieldrez;
  182.         char            filler[10];
  183. }; /* 32 */
  184.  
  185. struct descriptorpack {
  186.         unsigned        func;
  187.         unsigned        stat;
  188.         unsigned        handle;
  189.         unsigned        fieldnumber;
  190.         struct fielddesctype   fd;
  191. }; /* 40 */
  192.  
  193. struct dosfilepack {
  194.         unsigned        func;
  195.         unsigned        stat;
  196.         char       far *filenameptr;
  197.         unsigned        handle;
  198.         unsigned        asmode;
  199.         unsigned        bytes;
  200.         long            seekoffset;
  201.         unsigned        method;
  202.         void       far *bufferptr;
  203.         unsigned        attr;
  204.         char       far *newnameptr;
  205. }; /* 30 */
  206.  
  207. struct dvmonpack {
  208.         unsigned        func;
  209.         unsigned        stat;
  210.         unsigned        mode;
  211.         unsigned        handle;
  212.         unsigned        vs;
  213. }; /* 10 */
  214.  
  215. struct exitpack {
  216.         unsigned        func;
  217.         unsigned        stat;
  218. }; /* 4 */
  219.  
  220. struct handlepack {
  221.         unsigned        func;
  222.         unsigned        stat;
  223.         unsigned        handle;
  224. }; /* 6 */
  225.  
  226. struct initpack {
  227.         unsigned        func;
  228.         unsigned        stat;
  229.         unsigned        jftmode;
  230.         unsigned        dosver;
  231.         unsigned        version;
  232.         unsigned        osversion;
  233.         unsigned long   exitptr;
  234. }; /* 16 */
  235.  
  236. struct memorypack {
  237.         unsigned        func;
  238.         unsigned        stat;
  239.         unsigned long   memory;
  240. };
  241.  
  242. struct openpack {
  243.         unsigned        func;
  244.         unsigned        stat;
  245.         unsigned        handle;
  246.         char       far *filenameptr;
  247.         unsigned        asmode;
  248.         unsigned        xblink;
  249. }; /* 14 */
  250.  
  251. struct remotepack {
  252.         unsigned        func;
  253.         unsigned        stat;
  254.         unsigned        handle;
  255.         unsigned        isremote;
  256.         unsigned        flags;
  257.         unsigned        isshare;
  258. }; /* 12 */
  259.  
  260. struct setretriespack {
  261.         unsigned        func;
  262.         unsigned        stat;
  263.         unsigned        mode;
  264.         unsigned        pause;
  265.         unsigned        retries;
  266. }; /* 10 */
  267.  
  268. struct statdatapack {
  269.         unsigned        func;
  270.         unsigned        stat;
  271.         unsigned        handle;
  272.         unsigned char   filetype;
  273.         unsigned char   dirty;
  274.         unsigned long   recs;
  275.         unsigned        reclen;
  276.         unsigned        fields;
  277.         char            f1;
  278.         unsigned char   luyear;
  279.         unsigned char   lumonth;
  280.         unsigned char   luday;
  281.         unsigned        hereseg;
  282.         char            filler[10];
  283. }; /* 32 */
  284.  
  285. struct statkeypack {
  286.         unsigned        func;
  287.         unsigned        stat;
  288.         unsigned        handle;
  289.         unsigned char   filetype;
  290.         unsigned char   dirty;
  291.         unsigned long   keys;
  292.         unsigned        keylen;
  293.         unsigned        xblink;
  294.         unsigned long   xbrecno;
  295.         unsigned        hereseg;
  296.         unsigned        codepageid;
  297.         unsigned        countrycode;
  298.         unsigned        collatetablesize;
  299.         unsigned        keyflags;
  300.         char            filler[2];
  301. }; /* 32 */
  302.  
  303. struct stathandlepack {
  304.         unsigned        func;
  305.         unsigned        stat;
  306.         unsigned        handle;
  307.         unsigned        id;
  308.         char       far *filenameptr;
  309. }; /* 12 */
  310.  
  311. struct xerrorpack {
  312.         unsigned        func;
  313.         unsigned        stat;
  314.         unsigned        errclass;
  315.         unsigned        action;
  316.         unsigned        location;
  317. }; /* 10 */
  318.  
  319. #pragma pack()
  320. #define __BULLET_H
  321. #endif
  322.  
  323. /* end of BULLET.H */
  324.